package com.wenx.ftpcamel;

import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.model.ModelCamelContext;


/**
 * Created by wenx on 2019-07-22 10:07
 */
public class FileTest1 {

    public static void main(String[] args) throws Exception {
        ModelCamelContext camelContext = new DefaultCamelContext();

        camelContext.start();

        camelContext.addRoutes(new RouteBuilder() {

            @Override
            public void configure() {
                from("quartz://825da6a0-7a77-49bf-8bbe-0301f0ee6957?cron=0 * * * * ? *&stateful=true")
                        .setHeader(Exchange.FILE_NAME,constant("aa.txt"))
                        .setBody(constant("abcd"))
                        .to("file:D:\\test");
            }
        });

        synchronized (FileDemo1.class) {
            FileDemo1.class.wait();
        }
    }

}
